﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="NewPost.aspx.cs" Inherits="Presentation.Posts.NewPost" 
Title="Thêm bài viết mới"%>

<%@Register assembly="CKEditor.NET" namespace="CKEditor.NET" tagPrefix="CKEditor" %>
<asp:Content ID="AddNewPost" ContentPlaceHolderID="main" runat="server">
    <div id="create_post">
        <table cellspacing="0" width="100%" cellpadding="0">
            <tr>
                <td></td>
                <td>
                    <h3>Thêm bài viết mới</h3>
                </td>
            </tr>
            <tr>
                <td style="width: 20%; text-align: right; padding-right: 15px;">
                    Tiêu đề:
                </td>
                <td>
                    <asp:TextBox ID="PostTitle" runat="server" Width="300px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="PostTitle"
                    ErrorMessage="Không được để trống" ValidationGroup="Submit">
                    </asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td style="width: 20%; text-align: right; padding-right: 15px;">
                    Ảnh đại diện:
                </td>
                <td>
                    <asp:FileUpload ID="AvatarImage" runat="server"/>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="AvatarImage"
                    ErrorMessage="Bạn chưa upload ảnh." ValidationGroup="Submit"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td style="width: 20%; text-align: right; padding-right: 15px;">
                    Category: 
                </td>
                <td>
                    <asp:DropDownList ID="DropDownCategory" runat="server" DataTextField="CateName" DataValueField="CateId"
                    ></asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="DropDownCategory"
                    ErrorMessage="Lựa chọn một chuyên mục." ValidationGroup="Submit"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td style="width: 20%; text-align: right; padding-right: 15px;">
                    Tóm tắt:
                </td>
                <td>
                    <asp:TextBox ID="PostSummary" runat="server" TextMode="MultiLine"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidato4" runat="server" ControlToValidate="PostSummary"
                    ErrorMessage="Chưa nhập tóm tắt" ValidationGroup="Submit"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td style="width: 20%; text-align: right; padding-right: 15px;">
                    Nội dung
                </td>
                <td>
                    <CKEditor:CKEditorControl ID="TextContent" runat="server" Width="500px"></CKEditor:CKEditorControl>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <asp:CheckBox ID="IsAccept" runat="server" Text="Tôi đồng ý với các quy định của BQT Blog."/>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                   <asp:Button ID="Publish" runat="server" Text="Publish" ValidationGroup="Submit" 
                        onclick="Publish_Click"/>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>


